import { post, get } from '@/http';
// 导入类型
import {
    LoginRequest,
    LoginResponse,
    ReLoginRequest,
    UserInfo,
} from '@/api/user/types';

// post 请求直接传入一个 data 即可 url 我们直接在此处封装好
// 需要更改时也只需在此处更改
export const userLogin = (data?: LoginRequest) => {
    return post<LoginResponse>({}, '/login', data);
};

export const refreshUserInfo = (data?: ReLoginRequest) => {
    return post<LoginResponse>({}, '/getUserInfo', data);
};

export const userList = () => {
    return get<UserInfo[]>({}, '/getUserList', null);
};
